<cfsilent>
	<cfset discussionCategories = $.run.it('discussionService.getDiscussionCategories') />
	<cfset discussionCategoryID = $.request.getValue('discussionCategoryID') />
	<cfif discussionCategoryID eq "">
		<cfset discussionCategoryID = discussionCategories.id />
	</cfif>
	
	<cfset discussions = $.run.it('discussionService.getDiscussions',{discussionCategoryID=discussionCategoryID}) />
	<cfset title = "Discussions">
	<cfloop query="discussionCategories">
		<cfif discussionCategories.id eq discussionCategoryID>
			<cfset title = discussionCategories.name />
		</cfif>
	</cfloop>
	
</cfsilent>
<cfoutput>
	<cfsavecontent variable="page">
		<style>
			.category-select{
				width:261px;
				margin-bottom:5px !important;
			}
			.discussion{
				text-align:left;
				border:2px solid ##CFCFCF;
				margin:2px;
			}
			.question{
				margin:4px;
			}
			.feedback-open-message-message{
				font-size:11px;
			}
			.stats{
				color:##444444;
				font-size:11px;
				text-align:right;
				padding:2px 0px 0px 0px;
			}
			.stats > i{
				font-size:13px;
			}
		</style>
		
		<div class="header variable-width">
			<i class="fa fa-home" onclick="Main.nav('home');"></i>
			<div class="header-title">Discussion Hub</div>
			#$.render.img(path="craftivity/widget_icons/forums.png")#</br>
		</div>
		
		<!--- #$.render.form(name='select_category',class='widget short',method='discussionController.showCategory')#
			<div class="widget-form-title">The Forum</div>
			</br>
			#$.render.radio(
				name='discussionCategoryID',
				query=discussionCategories,
				value=discussionCategoryID,
				vertical=true,
				class="category-select",
				onchange="Worksheet.change(this);"
			)#
			<button name="go" class="red right" type="submit">Go</button>
		</form> --->
		
		<!--- <div class="widget short">
			<div class="widget-form-title">#title#</div>
			
			<cfloop query="discussions">
				<div class="discussion">
					#discussions.name#
					#$.render.form(name='follow_discussion',method='discussionController.followDiscussion')#
						<input type="hidden" name="discussionID" value="#discussions.id#" />
						<button class="right red" type="submit">Follow</button>
						<div style="clear:both;"></div>
					</form>
				</div>
			</cfloop>
		</div> --->
		
		<div class="widget short">
			<div class="widget-form-title">Business Related</div>
			<div class="discussion">
				<div class="question">
					I want to engage with sales reps but I'm not sure how?
				</div>
				<div class="feedback-open-message">
					<div class="feedback-open-message-who">Ken Schmidt @ <b>Toys B We</b> :</div>
					<div class="feedback-open-message-timestamp">8:12 PM - 3/13/14</div>
					<div class="feedback-open-message-message">I've heard other businesses having success with sales reps working on their line. Question I have is, where do you even get in touch with them?</div>
				</div>
				<div class="feedback-open-message">
					<div class="feedback-open-message-who you">Amy Vance @ <b>Deep Fried</b> :</div>
					<div class="feedback-open-message-timestamp">9:24 PM - 3/14/14</div>
					<div class="feedback-open-message-message">One of my reps approached me, and the other rep was referred by her. Hope that helps.</div>
				</div>
				<button class="left blue small">follow</button>
				<button class="right red small">respond</button>
				<div style="clear:Both;"></div>
			</div>
			<div class="discussion">
				<div class="question">
					Help my distributer client hasn't paid me for 90+ days (net 30 terms)!!
					<div class="stats">
						(2)<i class="fa-comment-o fa"></i>&nbsp;&nbsp;(5)<i class="fa-heart-o fa"></i>
					</div>
				</div>
			</div>
			<div class="discussion">
				<div class="question">
					Interviewing employees. Any tips?
					<div class="stats">
						(32)<i class="fa-comment-o fa"></i>&nbsp;&nbsp;(55)<i class="fa-heart-o fa"></i>
					</div>
				</div>
			</div>
			<button class="red right">Add Discussion</button>
		</div>
		
		<div class="widget short">
			<div class="widget-form-title">Marketing Discussions</div>
			<div class="discussion">
				<div class="question">
					How often should I be pushing content on facebook?
					<div class="stats">
						(15)<i class="fa-comment-o fa"></i>&nbsp;&nbsp;(32)<i class="fa-heart-o fa"></i>
					</div>
				</div>
			</div>
			<div class="discussion">
				<div class="question">
					Instagram. Worth the effort? Anyone seeing sales?
					<div class="stats">
						(125)<i class="fa-comment-o fa"></i>&nbsp;&nbsp;(332)<i class="fa-heart-o fa"></i>
					</div>
				</div>
			</div>
			<div class="discussion">
				<div class="question">
					How to use Google Analytics. The definitive guide.
					<div class="stats">
						(1)<i class="fa-comment-o fa"></i>&nbsp;&nbsp;(2)<i class="fa-heart-o fa"></i>
					</div>
				</div>
			</div>
			<div class="discussion">
				<div class="question">
					So this PR firm approached me about doing some work. Do these terms seem reasonable? What experiences have you had working with PR?
					<div class="stats">
						(4)<i class="fa-comment-o fa"></i>&nbsp;&nbsp;(7)<i class="fa-heart-o fa"></i>
					</div>
				</div>
			</div>
			<div class="discussion">
				<div class="question">
					Amazon Payments - a good platform?
					<div class="stats">
						(2)<i class="fa-comment-o fa"></i>&nbsp;&nbsp;(1)<i class="fa-heart-o fa"></i>
					</div>
				</div>
			</div>
			<button class="red right">Add Discussion</button>
		</div>
		
		<div class="widget short">
			<div class="widget-form-title">Legal Mumbo Jumbo</div>
			<div class="discussion">
				<div class="question">
					LLC Formation. Pros and Cons. Go.
					<div class="stats">
						(5)<i class="fa-comment-o fa"></i>&nbsp;&nbsp;(12)<i class="fa-heart-o fa"></i>
					</div>
				</div>
			</div>
			<div class="discussion">
				<div class="question">
					Nightmare - injury from using my product. Need advice stat!
					<div class="stats">
						(15)<i class="fa-comment-o fa"></i>&nbsp;&nbsp;(86)<i class="fa-heart-o fa"></i>
					</div>
				</div>
			</div>
			<div class="discussion">
				<div class="question">
					Trademarks and patents - worth the money?
					<div class="stats">
						(5)<i class="fa-comment-o fa"></i>&nbsp;&nbsp;(32)<i class="fa-heart-o fa"></i>
					</div>
				</div>
			</div>
			<div class="discussion">
				<div class="question">
					OMG copycats! ARRRGH!! copied my product AND my website.
					<div class="stats">
						(56)<i class="fa-comment-o fa"></i>&nbsp;&nbsp;(322)<i class="fa-heart-o fa"></i>
					</div>
				</div>
			</div>
			<div class="discussion">
				<div class="question">
					Tax time. Vent here.
					<div class="stats">
						(23)<i class="fa-comment-o fa"></i>&nbsp;&nbsp;(122)<i class="fa-heart-o fa"></i>
					</div>
				</div>
			</div>
			<div class="discussion">
				<div class="question">
					Nickel Cadmium testing. Do you do it?
					<div class="stats">
						(3)<i class="fa-comment-o fa"></i>&nbsp;&nbsp;(5)<i class="fa-heart-o fa"></i>
					</div>
				</div>
			</div>
			<button class="red right">add discussion</button>
		</div>
		
		<div class="widget short">
			<div class="widget-form-title">Craftivity Support</div>
			<div class="discussion">
				<div class="question">
					How do you decide what timezone to use when connecting to Google Calendar?
					<div class="stats">
						(1)<i class="fa-comment-o fa"></i>&nbsp;&nbsp;(23)<i class="fa-heart-o fa"></i>
					</div>
				</div>
			</div>
			<div class="discussion">
				<div class="question">
					Just wanted to let you guys know that everything works great!
					<div class="stats">
						(12)<i class="fa-comment-o fa"></i>&nbsp;&nbsp;(16)<i class="fa-heart-o fa"></i>
					</div>
				</div>
			</div>
			<button class="red right">add discussion</button>
		</div>

	</cfsavecontent>
	
	#application.v.craftivityView.renderPage(page)#
</cfoutput>